home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 676-700 / 681 / term / source.lha / termData.c < prev    next >
C/C++ Source or Header  |  1992-05-09  |  17KB  |  711 lines

  1. /*
  2. **    $Id: termdata.c,v 1.10 92/05/08 20:50:30 olsen Sta Locker: olsen $
  3. **    $Revision: 1.10 $
  4. **    $Date: 92/05/08 20:50:30 $
  5. **
  6. **    Global data structures
  7. **
  8. **    Copyright © 1990-1992 by Olaf `Olsen' Barthel & MXM
  9. **        All Rights Reserved
  10. */
  11.  
  12. #include "termGlobal.h"
  13.  
  14.     /* Libraries. */
  15.  
  16. struct ExecBase        *SysBase;
  17. struct DosLibrary    *DOSBase;
  18.  
  19. struct IntuitionBase    *IntuitionBase;
  20. struct GfxBase        *GfxBase;
  21. struct Library        *GadToolsBase;
  22. struct Library        *DiskfontBase;
  23. struct Library        *UtilityBase;
  24. struct Device        *TimerBase;
  25. struct Library        *AslBase;
  26. struct RxsLib        *RexxSysBase;
  27. struct Library        *IFFParseBase;
  28. struct Library        *CxBase;
  29. struct Library        *LayersBase;
  30. struct Library        *IconBase;
  31. struct Library        *WorkbenchBase;
  32. struct Library        *XEmulatorBase;
  33. struct Library        *OwnDevUnitBase;
  34.  
  35.     /* Timer device. */
  36.  
  37. struct timerequest    *TimeRequest;
  38. struct MsgPort        *TimePort;
  39.  
  40.     /* Console device. */
  41.  
  42. struct IOStdReq        *ConsoleRequest;
  43. struct Device        *ConsoleDevice;
  44. struct KeyMap        *KeyMap;
  45. BPTR             KeySegment;
  46.  
  47.     /* Screen & Windows. */
  48.  
  49. struct Screen        *Screen;
  50. struct Window        *Window;
  51. struct Window        *StatusWindow;
  52. UWORD             StatusOffset;
  53. APTR             OldWindowPtr;
  54. struct BitMap        *InterleavedBitMap;
  55. struct Requester    *RequesterList;
  56.  
  57.     /* Graphics rendering. */
  58.  
  59. struct ViewPort        *VPort;
  60. struct RastPort        *RPort;
  61. struct TextFont        *Topaz,
  62.             *IBM,
  63.             *GFX,
  64.             *CurrentFont;
  65. APTR             VisualInfo;
  66.  
  67. UWORD ANSIPens[NUMDRIPENS + 1] =
  68. {
  69.     0,4,7,7,4,6,7,0,6,~0
  70. };
  71.  
  72. UWORD EGAPens[NUMDRIPENS + 1] =
  73. {
  74.     0,8,15,15,8,7,15,0,7,~0
  75. };
  76.  
  77. UWORD AtomicColours[16] =
  78. {
  79.     0x000,
  80.     0xDDD,
  81.     0x000,
  82.     0x000,
  83.     0x000,
  84.     0x000,
  85.     0x000,
  86.     0x000,
  87.     0x000,
  88.     0x000,
  89.     0x000,
  90.     0x000,
  91.     0x000,
  92.     0x000,
  93.     0x000,
  94.     0x000
  95. };
  96.  
  97. UWORD EGAColours[16] =
  98. {
  99.     0x000,    /* Black. */
  100.     0xA00,    /* Dark red. */
  101.     0x0A0,    /* Dark green. */
  102.     0xA60,    /* Dark yellow (orange). */
  103.     0x00A,    /* Dark blue. */
  104.     0xA0A,    /* Dark magenta.*/
  105.     0x0AA,    /* Dark cyan. */
  106.     0xBBB,    /* Light grey. */
  107.     0x666,    /* Dark grey. */
  108.     0xF00,    /* Red. */
  109.     0x0F0,    /* Green. */
  110.     0xFF0,    /* Yellow. */
  111.     0x00F,    /* Blue. */
  112.     0xF0F,    /* Magenta. */
  113.     0x0FF,    /* Cyan. */
  114.     0xFFF    /* White. */
  115. };
  116.  
  117. UWORD ANSIColours[16] =
  118. {
  119.     0x000,    /* Black. */
  120.     0xF00,    /* Red. */
  121.     0x0F0,    /* Green. */
  122.     0xFF0,    /* Yellow. */
  123.     0x00F,    /* Blue. */
  124.     0xF0F,    /* Magenta. */
  125.     0x0FF,    /* Cyan. */
  126.     0xFFF,    /* White. */
  127.  
  128.     0x000,    /* Black. */
  129.     0xF00,    /* Red. */
  130.     0x0F0,    /* Green. */
  131.     0xFF0,    /* Yellow. */
  132.     0x00F,    /* Blue. */
  133.     0xF0F,    /* Magenta. */
  134.     0x0FF,    /* Cyan. */
  135.     0xFFF    /* White. */
  136. };
  137.  
  138. UWORD             DefaultColours[16],BlinkColours[16],StandardColours[16];
  139.  
  140.     /* DOS data. */
  141.  
  142. struct Process        *ThisProcess;
  143. struct Process        *StatusProcess;
  144. struct Process        *BufferProcess;
  145. struct Process        *RexxProcess;
  146. struct MsgPort        *TermRexxPort;
  147. struct WBStartup    *WBenchMsg;
  148. struct TermPort        *TermPort;
  149.  
  150.     /* Character conversion. */
  151.  
  152. struct InputEvent    *FakeInputEvent;
  153.  
  154.     /* Serial I/O. */
  155.  
  156. struct IOExtSer        *ReadRequest;
  157. struct IOExtSer        *WriteRequest;
  158. struct MsgPort        *ReadPort;
  159. APTR             ReadBuffer,
  160.              HostReadBuffer;
  161. UBYTE            *SerialMessage;
  162.  
  163.     /* Hotkeys. */
  164.  
  165. struct Hotkeys         Hotkeys;
  166.  
  167. struct NewBroker NewTermBroker =
  168. {
  169.     NB_VERSION,
  170.     "term",
  171.     "term © 1990-92 by MXM",
  172.     "Terminal program",
  173.     0,0,0,NULL,0
  174. };
  175.  
  176.     /* Static default fonts. */
  177.  
  178. struct TextAttr DefaultFont =
  179. {
  180.     (UBYTE *)"topaz.font",
  181.     8,
  182.     FS_NORMAL,
  183.     FPF_ROMFONT | FPF_DESIGNED
  184. };
  185.  
  186. struct TextAttr IBMFont =
  187. {
  188.     (UBYTE *)"IBM.font",
  189.     8,
  190.     FS_NORMAL,
  191.     FPF_DISKFONT | FPF_DESIGNED
  192. };
  193.  
  194. struct TextAttr GFXFont =
  195. {
  196.     (UBYTE *)"GFX.font",
  197.     8,
  198.     FS_NORMAL,
  199.     FPF_DISKFONT | FPF_DESIGNED
  200. };
  201.  
  202.     /* Audio data. */
  203.  
  204. UBYTE AnyChannel[4] =
  205. {
  206.     LEFT0F,
  207.     LEFT1F,
  208.     RIGHT0F,
  209.     RIGHT1F,
  210. };
  211.  
  212. UBYTE __chip SineWave[8] =
  213. {
  214.     90,
  215.     127,
  216.     90,
  217.     0,
  218.     -90,
  219.     -127,
  220.     -90,
  221.     0
  222. };
  223.  
  224. struct IOAudio    *AudioBlock;
  225.  
  226.     /* Character lookup tables. */
  227.  
  228. BYTE ValidTab[256] =
  229. {
  230.     0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,
  231.     0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,
  232.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  233.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  234.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  235.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  236.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  237.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
  238.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  239.     0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,
  240.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  241.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  242.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  243.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  244.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  245.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
  246. };
  247.  
  248.     /* IBM <-> Amiga/DEC font conversion. */
  249.  
  250. UBYTE IBMConversion[256] =
  251. {
  252.     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x00,0x00,
  253.     0x00,0x11,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0x00,0x00,0x00,0x00,
  254.     0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  255.     0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  256.     0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
  257.     0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
  258.     0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
  259.     0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
  260.     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  261.     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  262.     0x00,0xAD,0x9B,0x9C,0x00,0x9D,0x00,0x15,0x00,0x00,0xA6,0x00,0x00,0x00,0xAE,0x00,
  263.     0xF8,0xF1,0xFD,0x00,0x00,0xE6,0x14,0xF9,0x00,0x00,0xA7,0xAF,0xAC,0xAB,0x00,0xA8,
  264.     0x00,0x00,0x00,0x00,0x8E,0x8F,0x92,0x80,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,
  265.     0x00,0xA5,0x00,0x00,0x00,0x00,0x99,0x00,0x00,0x00,0x00,0x00,0x9A,0x00,0x00,0xE1,
  266.     0x85,0xA0,0x83,0x00,0x84,0x86,0x91,0x87,0x8A,0x82,0x88,0x89,0x8D,0xA1,0x8C,0x00,
  267.     0x00,0xA4,0x95,0xA2,0x93,0x00,0x94,0x00,0x00,0x97,0xA3,0x96,0x81,0x00,0x00,0x98
  268. };
  269.  
  270.     /* Table of graphics characters. */
  271.  
  272. BYTE GfxTable[256] =
  273. {
  274.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  275.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  276.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  277.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  278.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  279.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  280.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  281.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  282.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  283.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  284.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  285.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  286.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  287.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  288.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  289.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  290. };
  291.  
  292.     /* Special character treatment. */
  293.  
  294. struct SpecialKey SpecialKeys[11] =
  295. {
  296.     BEL,    DoSomeBeep,    /* Ring the bell. */
  297.     XON,    XOn,        /* Flow control - stop output. */
  298.     BKS,    DoBackspace,    /* Erase a character. */
  299.     ENT,    DoLF_FF_VT,    /* Enter key. */
  300.     FFD,    DoFF,        /* Form feed. */
  301.     VTB,    DoLF_FF_VT,    /* Vertical tab (huh?). */
  302.     RET,    DoCR,        /* Return key. */
  303.     TAB,    DoTab,        /* Move to next tab stop. */
  304.     SI,    DoShiftIn,    /* ^N Change to graphics mode */
  305.     SO,    DoShiftOut,    /* ^O Change out of graphics mode. */
  306.     ENQ,    DoEnq        /* Transmit answerback message. */
  307. };
  308.  
  309. UBYTE SpecialMap[256];
  310.  
  311.     /* Shared global string formatting buffer. */
  312.  
  313. UBYTE SharedBuffer[512];
  314.  
  315.     /* Screen pull-down-menu. */
  316.  
  317. struct NewMenu TermMenu[] =
  318. {
  319.     { NM_TITLE, NULL,         0 , 0, 0, (APTR)0},
  320.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_OPEN},
  321.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SAVE},
  322.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SAVEAS},
  323.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  324.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_PRINTSCREEN},
  325.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  326.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_ICONIFY},
  327.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  328.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_ABOUT},
  329.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  330.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_QUIT},
  331.  
  332.     { NM_TITLE, NULL,         0 , 0, 0, (APTR)0},
  333.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SETCONSOLE},
  334.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_DOSCOMMAND},
  335.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_REXXCOMMAND},
  336.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  337.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_PASTE},
  338.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  339.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_PACKET},
  340.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  341.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_FASTMACROPANEL},
  342.  
  343.     { NM_TITLE, NULL,         0 , 0, 0, (APTR)0},
  344.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_CLEARBUFFER},
  345.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_DISPLAYBUFFER},
  346.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_CLOSEBUFFER},
  347.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  348.     {  NM_ITEM, NULL,         0 , CHECKIT|MENUTOGGLE, 0, (APTR)MEN_FREEZEBUFFER},
  349.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  350.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_LOADBUFFER},
  351.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SAVEBUFFER},
  352.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  353.     {  NM_ITEM, NULL,         0 , CHECKIT|MENUTOGGLE, 0, (APTR)MEN_CAPTUREDISK},
  354.     {  NM_ITEM, NULL,         0 , CHECKIT|MENUTOGGLE, 0, (APTR)MEN_CAPTUREPRINTER},
  355.  
  356.     { NM_TITLE, NULL,         0 , 0, 0, (APTR)0},
  357.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_UPLOADTEXT},
  358.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_DOWNLOADTEXT},
  359.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  360.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SEND},
  361.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_RECEIVE},
  362.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  363.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_UPLOAD},
  364.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_DOWNLOAD},
  365.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  366.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_EDIT},
  367.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  368.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_XFERPROTOCOL},
  369.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SELECTXFER},
  370.  
  371.     { NM_TITLE, NULL,         0 , 0, 0, (APTR)0},
  372.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_PHONEBOOK},
  373.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_DIAL},
  374.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_REDIAL},
  375.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  376.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_PLAY},
  377.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  378.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SENDBREAK},
  379.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_FLUSHBUFFER},
  380.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_HANGUP},
  381.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  382.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_RELEASE},
  383.  
  384.     { NM_TITLE, NULL,         0 , 0, 0, (APTR)0},
  385.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_CLEARSCREEN},
  386.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_RESETSTYLES},
  387.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_RESETFONT},
  388.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_RESETTERMINAL},
  389.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  390.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SAVEILBM},
  391.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SAVEASCII},
  392.  
  393.     { NM_TITLE, NULL,         0 , 0, 0, (APTR)0},
  394.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SERIAL},
  395.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_MODEM},
  396.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SCREEN},
  397.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_TERMINAL},
  398.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_COMMANDS},
  399.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_MISC},
  400.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_PATH},
  401.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  402.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_MACROS},
  403.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_FASTMACROS},
  404.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_HOTKEYS},
  405.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_SPEECH},
  406.     {  NM_ITEM, NM_BARLABEL,     0 , 0, 0, (APTR)0},
  407.     {  NM_ITEM, NULL,         0 , 0, 0, (APTR)MEN_EMULATION},
  408.     {   NM_END, 0,             0 , 0, 0, (APTR)0},
  409. };
  410.  
  411. struct Menu *Menu;
  412.  
  413.     /* Pointer. */
  414.  
  415. UWORD __chip Stopwatch[(2 + 16) * 2] =
  416. {
  417.     0x0000,0x0000,
  418.  
  419.     0x0400,0x07C0,
  420.     0x0000,0x07C0,
  421.     0x0100,0x0380,
  422.     0x0000,0x07E0,
  423.     0x07C0,0x1FF8,
  424.     0x1FF0,0x3FEC,
  425.     0x3FF8,0x7FDE,
  426.     0x3FF8,0x7FBE,
  427.     0x7FFC,0xFF7F,
  428.     0x7EFC,0xFFFF,
  429.     0x7FFC,0xFFFF,
  430.     0x3FF8,0x7FFE,
  431.     0x3FF8,0x7FFE,
  432.     0x1FF0,0x3FFC,
  433.     0x07C0,0x1FF8,
  434.     0x0000,0x07E0,
  435.  
  436.     0x0000,0x0000
  437. };
  438.  
  439.     /* Configuration. */
  440.  
  441. struct Configuration     Config;
  442. struct Configuration     PrivateConfig;
  443. struct SpeechConfig     SpeechConfig;
  444. BYTE             English = TRUE;
  445. BYTE             Status;
  446. BYTE             Online;
  447. struct Configuration    *BackupConfig;
  448. UWORD             PublicModes;
  449.  
  450. UBYTE             LastConfig[256];
  451. UBYTE             DefaultPubScreen[MAXPUBSCREENNAME];
  452.  
  453.     /* These are the sixteen more or less different display modes the
  454.      * term main and buffer display screens will be opened in.
  455.      */
  456.  
  457. ULONG ModeID[16] =
  458. {
  459.     DEFAULT_MONITOR_ID|HIRES_KEY,
  460.     DEFAULT_MONITOR_ID|HIRESLACE_KEY,
  461.     DEFAULT_MONITOR_ID|SUPER_KEY,
  462.     DEFAULT_MONITOR_ID|SUPERLACE_KEY,
  463.     DEFAULT_MONITOR_ID|VGAPRODUCT_KEY,
  464.     DEFAULT_MONITOR_ID|VGAPRODUCTLACE_KEY,
  465.  
  466.     PAL_MONITOR_ID|HIRES_KEY,
  467.     PAL_MONITOR_ID|HIRESLACE_KEY,
  468.     PAL_MONITOR_ID|SUPER_KEY,
  469.     PAL_MONITOR_ID|SUPERLACE_KEY,
  470.  
  471.     NTSC_MONITOR_ID|HIRES_KEY,
  472.     NTSC_MONITOR_ID|HIRESLACE_KEY,
  473.     NTSC_MONITOR_ID|SUPER_KEY,
  474.     NTSC_MONITOR_ID|SUPERLACE_KEY,
  475.  
  476.     A2024TENHERTZ_KEY,
  477.     A2024FIFTEENHERTZ_KEY
  478. };
  479.  
  480.     /* Capture file. */
  481.  
  482. struct Buffer        *FileCapture;
  483. BPTR             PrinterCapture;
  484. UBYTE             CaptureName[256];
  485. BYTE             StandardPrinterCapture,
  486.              ControllerActive;
  487.  
  488.     /* Buffer. */
  489.  
  490. UBYTE            **BufferLines;
  491. LONG             Lines;
  492. struct SignalSemaphore    *BufferSemaphore;
  493. LONG             MaxLines = 100;
  494. LONG             BufferSpace;
  495. BYTE             BufferClosed;
  496. BYTE             BufferFrozen;
  497.  
  498.     /* Phonebook. */
  499.  
  500. struct PhoneEntry    **Phonebook;
  501. LONG             PhoneSize;
  502. LONG             NumPhoneEntries;
  503. UBYTE             PhonePassword[256];
  504. BYTE             PhonePasswordUsed;
  505.  
  506. UBYTE             LastPhone[256];
  507. UBYTE             LastKeys[256];
  508. UBYTE             LastMacros[256];
  509. UBYTE             LastSpeech[256];
  510.  
  511. struct MacroKeys    *MacroKeys;
  512.  
  513.     /* Console stuff. */
  514.  
  515. UBYTE            *StripBuffer;
  516. UWORD             LastLine,LastColumn,LastPixel;
  517. BYTE             Charset,Attributes,FgPen,BgPen;
  518. WORD             CursorX,CursorY,Top,Bottom;
  519. BYTE             UseRegion,RegionSet,InSequence,Quiet,Blocking;
  520. BYTE             TabStops[1024];
  521. BYTE             CharMode[2];
  522.  
  523. BYTE             ResetDisplay = FALSE,Escape = FALSE;
  524.  
  525.     /* Flow filter. */
  526.  
  527. UBYTE            *AttentionBuffers[8],AttentionCount[8],FlowCount;
  528. BYTE             BaudPending,FullCheck;
  529. UBYTE             BaudBuffer[20],BaudCount;
  530.  
  531. struct FlowInfo         FlowInfo;
  532.  
  533.     /* Transfer data. */
  534.  
  535. LONG             FileCount,FileCountMax;
  536. struct WBArg        *FileArg;
  537. BYTE             MultipleFiles,FileMatch,BinaryTransfer;
  538. struct AnchorPath    *FileAnchor;
  539. LONG             TransferBits;
  540.  
  541. UBYTE            *DownloadPath;
  542. BYTE             Uploading;
  543. BYTE             DidTransfer;
  544.  
  545. struct Window        *TransferWindow;
  546. struct Menu        *TransferMenu;
  547. struct Gadget        *TransferGadgetArray[8];
  548. struct List         TransferInfoList;
  549.  
  550. struct Library        *XProtocolBase;
  551. struct XPR_IO        *XprIO;
  552.  
  553. UBYTE             ProtocolOptsBuffer[256];
  554. BYTE             NewLibrary,NewOptions;
  555. UBYTE             LastXprLibrary[256];
  556. UBYTE             ConvNumber[30],ConvNumber10[30];
  557. BYTE             UsesZModem,SendAbort,TransferAborted;
  558.  
  559.     /* The standard ZModem cancel sequence
  560.      * (ten CAN chars followed by ten
  561.      * BS chars).
  562.      */
  563.  
  564. UBYTE ZModemCancel[] =
  565. {
  566.     24,24,24,24,24,24,24,24,24,24,8,8,8,8,8,8,8,8,8,8
  567. };
  568.  
  569.     /* Pay per minute. */
  570.  
  571. LONG             CurrentPay;
  572. LONG             PayPerUnit[2];
  573. LONG             SecPerUnit[2];
  574. LONG             TimeOfDay[2];
  575. WORD             PreferredTime;
  576. UBYTE             Password[20];
  577. UBYTE             UserName[20];
  578. struct PhoneEntry    *ChosenEntry;
  579. BYTE             ChosenInUse;
  580.  
  581.     /* Execute a command/script. */
  582.  
  583. UBYTE             WindowName[256];
  584.  
  585.     /* Rexx server info. */
  586.  
  587. BYTE             WeAreBlocking;
  588.  
  589.     /* Dial list. */
  590.  
  591. struct List        *DialList;
  592.  
  593. BYTE             SendStartup;
  594.  
  595.     /* TermMain data. */
  596.  
  597. BYTE             ReleaseSerial;
  598. BYTE             ResetSerial;
  599. BYTE             BatchMode;
  600. BYTE             SerialSet;
  601.  
  602.     /* Upload/Download paths. */
  603.  
  604. UBYTE             LastDownload[256];
  605. UBYTE             LastUpload[256];
  606.  
  607.     /* String gadgets hooks. */
  608.  
  609. struct Hook         CommandHook;
  610. BYTE             DontActivate;
  611.  
  612. struct Window        *CommandWindow;
  613. struct Gadget        *CommandGadget;
  614. struct Gadget        *ActiveGadget;
  615.  
  616. struct Process        *ClipProcess;
  617. struct MsgPort        *ClipPort;
  618.  
  619.     /* Packet window. */
  620.  
  621. struct Window        *PacketWindow;
  622. struct Gadget        *PacketGadgetArray[2];
  623. struct Menu        *PacketMenu;
  624. struct Gadget        *PacketGadgetList;
  625. struct List         PacketHistoryList;
  626.  
  627.     /* Some more colour control flags. */
  628.  
  629. BYTE             Initializing,LoadColours;
  630.  
  631.     /* The character raster. */
  632.  
  633. UBYTE            *Raster,*RasterAttr;
  634. WORD             RasterWidth,RasterHeight;
  635.  
  636.     /* File download tracking. */
  637.  
  638. struct SignalSemaphore    *DownloadSemaphore;
  639. struct List         DownloadList;
  640. LONG             DownloadLineCount;
  641. struct Node        *DownloadNode;
  642.  
  643.     /* Rexx scanning sequences. */
  644.  
  645. struct List         SequenceList;
  646. LONG             SequenceCount;
  647.  
  648.     /* File version test. */
  649.  
  650. ULONG VersionProps[2] =
  651. {
  652.     'TERM',
  653.     'VERS'
  654. };
  655.  
  656.     /* Cause a rexx command to terminate without waiting. */
  657.  
  658. BYTE             ExitQuietly;
  659.  
  660.     /* The ARexx output window. */
  661.  
  662. struct Window        *RexxWindow;
  663.  
  664.     /* Window stack. */
  665.  
  666. struct Window        *TopWindow;
  667.  
  668. struct Window        *WindowStack[5];
  669. WORD             WindowStackPtr;
  670.  
  671.     /* Global term ID. */
  672.  
  673. LONG             TermID;
  674. UBYTE             TermIDString[MAXPUBSCREENNAME + 1];
  675.  
  676.     /* Fast! macros. */
  677.  
  678. struct List         FastMacroList;
  679. LONG             FastMacroCount;
  680. UBYTE             LastFastMacros[256];
  681. struct Window        *FastWindow;
  682. struct Gadget        *FastGadget;
  683.  
  684.     /* Double-buffered file locking. */
  685.  
  686. struct List         DoubleBufferList;
  687. struct SignalSemaphore     DoubleBufferSemaphore;
  688.  
  689.     /* XEM interface. */
  690.  
  691. struct XEM_IO        *XEM_IO;
  692. ULONG             XEM_Signal;
  693. struct XEmulatorHostData XEM_HostData;
  694. UBYTE            *OptionTitle;
  695. struct List         XEM_MacroList;
  696. struct XEmulatorMacroKey *XEM_MacroKeys;
  697. UBYTE             EmulationName[40];
  698.  
  699. struct List         EmptyList;
  700.  
  701.     /* Screen scrolling support. */
  702.  
  703. UBYTE             ScrollLineFirst,ScrollLineLast,
  704.              ScrollLineCount;
  705. struct ScrollLineInfo    *ScrollLines;
  706.  
  707.     /* term review buffer. */
  708.  
  709. struct MsgPort        *ReviewPort;
  710. struct Window        *ReviewWindow;
  711.